//
//  Mine_header_TableViewCell.swift
//  Pods
//
//  Created by eme on 2017/3/23.
//
//

import UIKit
import RickonCore

class Mine_header_TableViewCell: UITableViewCell {
    
    @IBOutlet weak var header_ImageView: UIImageView!   //头像
    @IBOutlet weak var nameLabel: UILabel!              //姓名
    @IBOutlet weak var Message_Button: UIButton!        //消息按钮
    @IBOutlet weak var MessageCountLabel: UILabel!      //消息数量
    @IBOutlet weak var loginButton: UIButton!           //登录按钮
    
    var item:OrderNumModel?{
        didSet{
            if let model = item{
                if model.message_Num == ""{
                    Message_Button.setImage(UIImage(named: "xiaoxi-readed", in: SansaCore.bundle, compatibleWith: nil), for: .normal)
//                    self.MessageCountLabel.isHidden = true
//                    self.MessageCountLabel.text = ""
                }else{
                    Message_Button.setImage(UIImage(named: "xiaoxi-unread", in: SansaCore.bundle, compatibleWith: nil), for: .normal)
//                    self.MessageCountLabel.isHidden = true
//                    self.MessageCountLabel.text = model.message_Num
                }
                
            }
        }
    }
    
    
    
    override func awakeFromNib() {
        super.awakeFromNib()
        self.setHeaderImageView()
//        self.MessageCountLabel.backgroundColor = Theme.sansa.MessageCountBg
        self.nameLabel.normal_fontSize(15)
        self.loginButton.layer.masksToBounds = true
        self.loginButton.layer.cornerRadius = 4
//        self.l
    }

    
    func setupMssageCountLabel(){
        //-----先隐藏消息数量Label
        MessageCountLabel.isHidden = true
        MessageCountLabel.layer.masksToBounds = true
        MessageCountLabel.layer.cornerRadius = 9
        MessageCountLabel.layer.borderColor = Theme.sansa.MessageCountBorderColor.cgColor
        MessageCountLabel.layer.borderWidth = 1
    }
    func setHeaderImageView(){
        header_ImageView.layer.masksToBounds = true
        header_ImageView.layer.cornerRadius = 35
        self.header_ImageView.isUserInteractionEnabled = true
        
    }
    
    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }

}
